package com.example.springboot_jap_model.exception;

import com.example.springboot_jap_model.enums.RespEntityEnum;

/**
 * 1.权限拦截
 *      自定义异常，在集成 runtime 时候 可触发 事务回滚
 */
public class LoginException extends RuntimeException {
    private Integer code;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public LoginException(RespEntityEnum respEntityEnum) {
        super(respEntityEnum.getMsg());
        this.code = respEntityEnum.getCode();
    }
}
